import { Component } from '@angular/core';
import { NavController, NavParams } from 'ionic-angular';
import { Plan } from '../plan/plan';
import { PlanInforPage } from '../planInfor/planInfor';
import { HabitService } from '../../service/habit.service';

@Component({
  selector: 'page-planAdd',
  templateUrl: 'planAdd.html'
})
export class PlanAddPage {
  
  constructor(public navCtrl: NavController, public navParams : NavParams, public habitService : HabitService) {
    
  }

  enterPlanInforPage(){
    //this.habitService.planList.push(new Plan(this.habitService.planList.length,null,null,0,0));
    this.navCtrl.push(PlanInforPage,{
      plan : new Plan(this.habitService.planList.length + 1,null,null,0,0,null,null,null),
      isEdit : true,
      isAdd : true
    })
  }

}
